/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.entities;

import com.buanalintas.bynga.entities.MasterUnit;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author user
 */
@Entity
@Table(name = "pos_master_price_warehouse")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosMasterPriceWarehouse.findAll", query = "SELECT p FROM PosMasterPriceWarehouse p"),
//    @NamedQuery(name = "PosMasterPriceWarehouse.findBySync", query = "SELECT p FROM PosMasterPriceWarehouse p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosMasterPriceWarehouse.findByPriceId", query = "SELECT p FROM PosMasterPriceWarehouse p WHERE p.priceId = :priceId"),
//    @NamedQuery(name = "PosMasterPriceWarehouse.findByPricePrice", query = "SELECT p FROM PosMasterPriceWarehouse p WHERE p.pricePrice = :pricePrice")})
public class PosMasterPriceWarehouse implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "price_id")
    private Integer priceId;
    @Column(name = "price_price")
    private BigDecimal pricePrice;
    @Lob
    @Column(name = "price_description")
    private String priceDescription;
    
    @Column(name = "price_wh_outlet_price")
    private BigDecimal priceWhOutletPrice;
    @Column(name = "price_wh_mk_price")
    private BigDecimal priceWhMkPrice;
    
    @JoinColumn(name = "price_pos_unit_id", referencedColumnName = "unit_id")
    @ManyToOne(optional = false)
    private PosMasterUnit pricePosUnitId;
    @JoinColumn(name = "price_item_id", referencedColumnName = "item_id")
    @ManyToOne(optional = false)
    private PosMasterItem priceItemId;

    public PosMasterPriceWarehouse() {
    }

    public PosMasterPriceWarehouse(Integer priceId) {
        this.priceId = priceId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getPriceId() {
        return priceId;
    }

    public BigDecimal getPriceWhMkPrice() {
        return priceWhMkPrice;
    }

    public void setPriceWhMkPrice(BigDecimal priceWhMkPrice) {
        this.priceWhMkPrice = priceWhMkPrice;
    }

    public BigDecimal getPriceWhOutletPrice() {
        return priceWhOutletPrice;
    }

    public void setPriceWhOutletPrice(BigDecimal priceWhOutletPrice) {
        this.priceWhOutletPrice = priceWhOutletPrice;
    }

    public void setPriceId(Integer priceId) {
        this.priceId = priceId;
    }

    public BigDecimal getPricePrice() {
        return pricePrice;
    }

    public void setPricePrice(BigDecimal pricePrice) {
        this.pricePrice = pricePrice;
    }

    public String getPriceDescription() {
        return priceDescription;
    }

    public void setPriceDescription(String priceDescription) {
        this.priceDescription = priceDescription;
    }

    public PosMasterItem getPriceItemId() {
        return priceItemId;
    }

    public void setPriceItemId(PosMasterItem priceItemId) {
        this.priceItemId = priceItemId;
    }

    public PosMasterUnit getPricePosUnitId() {
        return pricePosUnitId;
    }

    public void setPricePosUnitId(PosMasterUnit pricePosUnitId) {
        this.pricePosUnitId = pricePosUnitId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (priceId != null ? priceId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosMasterPriceWarehouse)) {
            return false;
        }
        PosMasterPriceWarehouse other = (PosMasterPriceWarehouse) object;
        if ((this.priceId == null && other.priceId != null) || (this.priceId != null && !this.priceId.equals(other.priceId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ronsicecream.pos.entities.PosMasterPriceWarehouse[ priceId=" + priceId + " ]";
    }
    
}
